Add `--name` and `--example` to cargo run
authorTomas Sedovic <tomas@sedovic.cz>
Mon, 27 Oct 2014 21:49:20 +0000 (22:49 +0100)
committerTomas Sedovic <tomas@sedovic.cz>
Tue, 28 Oct 2014 23:20:44 +0000 (00:20 +0100)
commitf2770b31bee2bbb4160b474866076e13d17b9be5
tree8f8cbc0090f577c58d910c5290e406d6012c3778
parent947a62b7db0a105d7ba70d3ea77be0a21e7e1bd9
Add `--name` and `--example` to cargo run

This lets us compile and run examples using `cargo run --example NAME`.
Selecting the other binary targets is now done using the `--name` flag.

`cargo run` falls back to the old behaviour (running the only bin target
in the project, failing if there are more) in neither `--name` nor
`--example` are present.

Closes #538
src/bin/run.rs
src/cargo/ops/cargo_run.rs
tests/test_cargo_run.rs